package com.basker.pisces.domain.event.handler.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.stereotype.Component;

import com.basker.pisces.domain.entity.meta.Entity;
import com.basker.pisces.domain.event.handler.IDomainEventHanlder;

/**
 * {@link IDomainEventHanlder}实现类的注解，可以限定特定的事件源
 *
 * @author hangwen
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(value = {ElementType.TYPE})
@Component
public @interface DomainEventHandler {

    /**
     * 限定的命令名称
     *
     * @return
     */
    String[] limitCommandName() default {};

    /**
     * 限定的实体类型
     *
     * @return
     */
    Class<? extends Entity>[] limitEntityType() default {};
}
